import fetch from '@/api'

// 堆场管理-分页
export function getYardMsgList (params) {
    return fetch({
        method:'get',
        url:`/yardMsg`,
        params
    });
};

// 堆场管理-新增
export function addYardMsg (data) {
    return fetch({
        method:'post',
        url:`/yardMsg`,
        data
    });
};
// 堆场管理-编辑
export function updateYardMsg (id,data) {
    return fetch({
        method:'put',
        url:`/yardMsg/${id}`,
        data
    });
};
// 堆场管理-删除
export function deleteYardMsg (id) {
    return fetch({
        method:'delete',
        url:`/yardMsg/${id}`
    });
};

// 堆场机械管理-分页
export function getYardMachineList (params) {
    return fetch({
        method:'get',
        url:`/containerYardMachine`,
        params
    });
};

// 堆场机械管理-新增
export function addYardMachine (data) {
    return fetch({
        method:'post',
        url:`/containerYardMachine`,
        data
    });
};
// 堆场机械管理-编辑
export function updateYardMachine (id,data) {
    return fetch({
        method:'put',
        url:`/containerYardMachine/${id}`,
        data
    });
};
// 堆场机械管理-删除
export function deleteYardMachine (id) {
    return fetch({
        method:'delete',
        url:`/containerYardMachine/${id}`
    });
};

// 堆场策划类型-分页
export function getYardPlanTypeList (params) {
    return fetch({
        method:'get',
        url:`/containerYardPlanType`,
        params
    });
};

// 堆场策划类型-新增
export function addYardPlanType (data) {
    return fetch({
        method:'post',
        url:`/containerYardPlanType`,
        data
    });
};
// 堆场策划类型-编辑
export function updateYardPlanType (id,data) {
    return fetch({
        method:'put',
        url:`/containerYardPlanType/${id}`,
        data
    });
};
// 堆场策划类型-删除
export function deleteYardPlanType (id) {
    return fetch({
        method:'delete',
        url:`/containerYardPlanType/${id}`
    });
};

// 因素来源
export function getAttr(params) {
    return fetch({
        method:'get',
        url:`/containerYardStackPlanFactorSource`,
        params
    })
}

// 堆场策划获取数据
export function getYardStackPlan(id, data) {
    return fetch({
        method: 'get',
        url: `/yardStackPlan/${id}`,
        data,
    })
}

// 堆场策划编辑
export function updateYardStackPlan(id,data) {
    return fetch({
        method:'put',
        url: `/yardStackPlan/${id}`,
        data,
    })
}

// 堆场图-查询
export function getYardMap(params) {
    return fetch({
        method: "get",
        url: `/containerYardField/yardStatus`,
        params
    });
};

// 堆场图-场位布控
export function yardMapControll(id,data) {
    return fetch({
        method: "post",
        url: `/containerYardField/${id}/controlling`,
        data
    });
};

// 堆场图-箱布控
export function yardMapContainerControll(id,data) {
    return fetch({
        method: "post",
        url: `/containerYardField/${id}/controlling/container`,
        data
    });
}

// 堆场图-查询箱信息
export function getYardMapContainerInfo(containerNo) {
    return fetch({
        method: "get",
        url: `/containerYardField/container/${containerNo}`,
    });
}

// 堆场图-移箱(堆场整理)
export function yxYardMap(data){
    return fetch({
        method:'post',
        url:`/containerYardField/move/container`,
        data
    })
}

// 堆场图-统计
export function yxYardMapAcc(params){
    return fetch({
        method:'get',
        url:`/containerYardField/yardStatus/count`,
        params
    })
}

// 进出口
export function Trading(data){
    return fetch({
        method:'get',
        url:`/containerYardField/yardStatus`,
        data
    })
}
